<?php 
include 'conexion.php';
$path = '../music/';
$streamkey = $_GET["streamkey"];
$conx = conectarBD();
$result = consultarBD($conx,$streamkey);
$track = mysql_result($result, 0, "url");
$track = $path.$track;
mysql_close($conx);
if (file_exists($track)) {
	header("Content-Type: audio/mpeg");
	header('Content-Length: ' . filesize($track));
	header('Content-Disposition: inline; filename="'.$track.'"');
	header('X-Pad: avoid browser bug');
	header('Cache-Control: no-cache');
	readfile($track);
	exit;
} else {
	header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found', true, 404);
	echo "no file";
}
?>